home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_rotor.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  724 b   |  30 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import rotor
  5. r = rotor.newrotor("you'll never guess this")
  6. r = rotor.newrotor("you'll never guess this", 12)
  7. A = 'spam and eggs'
  8. B = 'cheese shop'
  9. a = r.encrypt(A)
  10. print `a`
  11. b = r.encryptmore(B)
  12. print `b`
  13. A1 = r.decrypt(a)
  14. print A1
  15. if A1 != A:
  16.     print 'decrypt failed'
  17.  
  18. B1 = r.decryptmore(b)
  19. print B1
  20. if B1 != B:
  21.     print 'decryptmore failed'
  22.  
  23.  
  24. try:
  25.     r.setkey()
  26. except TypeError:
  27.     pass
  28.  
  29. r.setkey('you guessed it!')
  30.